<script type="text/javascript">
$(document).ready(function(){
    var flag = 0;
    $('nav ul.nav li a').each(function(){

        if($(this).hasClass('submenu')) {

            if($($(this))[0].href==String(window.location)) {

                $(this).parent().parent().parent().addClass('current');
            }

        } else {

            if($($(this))[0].href==String(window.location)) {

                $(this).parent().addClass('current');
                flag = 1;
            }
        }
    })
    // if(flag == 0){
    //     $("nav ul.nav li[class=home]").addClass("current");
    // }
});
</script>
<script type="text/javascript" >
    $(document).ready(function(){
        var now = new Date();
        var outStr = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
        
        $('st_main:first-child').addClass('st_maina').removeClass('st_main');
        // $('.st_main:gt(0)').addClass('st_main').removeClass('st_maina');
        setInterval(autoChange, 4000);
    });
    function autoChange()
    {
        if($("img.st_maina").length == 0){
            $('.st_main:first-child').addClass('st_maina').removeClass('st_main');
        }
        else
        {
            $("img.st_maina").addClass('st_main').removeClass('st_maina').next(".st_main").addClass('st_maina').removeClass('st_main');
            if($("img.st_maina").length == 0){
                $('.st_main:first-child').addClass('st_maina').removeClass('st_main');
            }
        }            
    }
</script>
<div class="logo">
    <h1>
        <a href="<?php echo Yii::app()->homeUrl; ?>">xachdo.vn</a>
    </h1>
</div>
<nav>
    <ul class="nav">
        <?php foreach($menu as $value) : ?>
        <?php if($value['type'] == 1) :?>
        <li class="<?php echo $value['description']; ?>">
            <a href="<?php echo Yii::app()->baseUrl . "/" . $value['access_url']; ?>">
                <?php echo $value['name']; ?>
            </a>
        </li>
        <?php endif; ?>
        <?php endforeach;?>
    </ul>
</nav>
<p class="cp_right">
    &copy XachDo.vn giữ mọi bản quyền
</p>
